package com.hzj.recipe.mapper;

import com.hzj.recipe.entity.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
* @author 蜗牛菌
* @description 针对表【comment(评论表)】的数据库操作Mapper
* @createDate 2024-01-04 10:49:47
* @Entity com.hzj.recipe.entity.Comment
*/
@Repository
public interface CommentMapper extends BaseMapper<Comment> {
    //分页查找食谱的评论列表
    List<Comment> selectCommentsByRecipeId(Integer index, Integer size, @Param("recipeId") Serializable id);

    //查找食谱的回复列表
    List<Comment> selectCommentsByCommentParentId(Serializable recipeId, Integer commentId);

    //按回复对象查询回复
    List<Comment> selectReplysByCommentParentId(Integer index, Integer size, @Param("targetId")Serializable targetId);

}




